package com.blog.dazi.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TvService {

    @Autowired
    private JdbcTemplate jdbcTemplate;
    public List<Map<String, Object>> list(int pageNum,int pageSize) {

        String sql = "select a.id,a.room_name roomName,a.url,b.photo from sys_tv a,sys_user_photo b where a.photo_id = b.id limit ?,?";
        int start = (pageNum-1)*pageSize;
        return jdbcTemplate.queryForList(sql,start,pageSize);
    }
}
